//
//  OPSendPost.h
//  OPFramework
//
//  Created by malcom on 7/22/08.
//  Copyright 2008 malcom-mac software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OPBaseObject.h"
#import "OPPost.h"
#import "OPUser.h"
#import "OPTopic.h"

@interface OPSendPost : OPBaseObject {
	NSMutableString		*p_messageText;			// the text of the message
	int					p_topic;				// the topic where you want to send the message (if you have inited it as reply)
	int					p_forum;				// the destionation forum for a new topic (if you have inited it as new post)
	
	NSString			*p_subject;				// subject of the post (inited with the topic standard post)
	NSString			*p_password;			// send require a password?
	
	BOOL				p_includeSignature;		// include your personal signature at the end of the post
	BOOL				p_enableBBCodes;		// enable bbcodes in post
	BOOL				p_enableURLs;			// enable urls in post
	BOOL				p_enableSmiles;			// enable smiles in post

	NSNumber			*p_postID;				// the id of the new post (before sending message it's nil)
}

@property (assign)		BOOL				p_includeSignature;
@property (assign)		BOOL				p_enableBBCodes;
@property (assign)		BOOL				p_enableURLs;
@property (assign)		BOOL				p_enableSmiles;
@property (retain)		NSString			*p_subject;
@property (retain)		NSMutableString		*p_messageText;
@property (readonly)	NSNumber			*p_postID;
@property (assign)		NSString			*p_password;

#pragma mark INIT
- (id) initToReplyToTopic:(OPTopic *) _topid quoting:(NSArray *) _quotes fromBoard:(OPBoard *) _board;
- (id) initNewPostWithSubject:(NSString *) _subject message:(NSString *) _message inForum:(OPForum *) _forum;

#pragma mark PUBLIC METHODS
- (NSNumber *) sendMessageWithPassword:(NSString *) _password;
- (OPTopic *) getParentTopic;
- (int) getPostPageIndexInTopic;

#pragma mark PRIVATE METHODS
- (void) _generareQuotesFromPosts:(NSArray *) _quotes;
- (void) _parseSendResult:(NSArray *) _result;

@end
